#include "stdio.h"
#include "math.h"

void main()
{
	int ncase,fcase;
	long int n,i;
	double x[3],y[3],mx[2],my[2],w1,w2;
	FILE *in,*out;


	in=fopen("stone.in","r");
	out=fopen("out1.txt","w");
//	in=stdin;
//	out=stdout;
	fscanf(in,"%d",&ncase);
	for (fcase=0;fcase<ncase;fcase++)
	{
		fscanf(in,"%ld",&n);
		fscanf(in,"%lf%lf",&x[0],&y[0]);
		fscanf(in,"%lf%lf",&x[1],&y[1]);
		fscanf(in,"%lf%lf",&x[2],&y[2]);
		mx[0]=(x[0]+x[1]+x[2])/3;
		my[0]=(y[0]+y[1]+y[2])/3;
		w1=(x[0]*y[1]+x[1]*y[2]+x[2]*y[0]-y[0]*x[1]-y[1]*x[2]-y[2]*x[0])/2;
		
		for (i=4;i<=n;i++)
		{
			x[1]=x[2];y[1]=y[2];
			fscanf(in,"%lf%lf",&x[2],&y[2]);
			mx[1]=(x[0]+x[1]+x[2])/3;
			my[1]=(y[0]+y[1]+y[2])/3;
			w2=(x[0]*y[1]+x[1]*y[2]+x[2]*y[0]-y[0]*x[1]-y[1]*x[2]-y[2]*x[0])/2;
			if ((w1+w2)==0) w2+=1e-6;
			
			mx[0]=w1/(w1+w2)*(mx[1]-mx[0])+mx[0];
			my[0]=w1/(w1+w2)*(my[1]-my[0])+my[0];
			w1+=w2;			
		}
		fprintf(out,"%.2lf %.2lf\n",mx[0]+1e-6,my[0]+1e-6);


		
	}
}




